package util;

import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;

public class MyClassLoad extends ClassLoader {
    public Class<?> load(String classPath) {
        byte[] classByte = null;
        Path path = null;
        try {
            path = Paths.get(classPath);
            classByte = Files.readAllBytes(path);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return defineClass("server.LagouDemoServlet", classByte, 0, classByte.length);
    }
}
